﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SIAKADCORE.Models
{
    /// <summary>
    /// Kelas Role [dbo].[role]
    /// </summary>
    public class Role
    {
        #region Constants
        /// <summary>
        /// Konstanta panjang id dari primary key
        /// </summary>
        public const int IdLength = 5;
        /// <summary>
        /// Konstanta prefix dari primary key
        /// </summary>
        public const string IdPrefix = "RL";
        /// <summary>
        /// Konstanta nama tabel pada database
        /// </summary>
        public const string TableName = "[dbo].[role]";
        /// <summary>
        /// Konstanta nama kolom idRole pada tabel
        /// </summary>
        public const string ColumnNameIdRole = "[id_role]";
        /// <summary>
        /// Konstanta nama kolom namaRole pada tabel
        /// </summary>
        public const string ColumnNameNamaRole = "[nama_role]"; 
        #endregion

        #region Fields
        /// <summary>
        /// [id_role] CHAR(5) PRIMARY KEY
        /// </summary>
        private string idRole;
        /// <summary>
        /// [nama_role] VARCHAR(50) NOT NULL
        /// </summary>
        private string namaRole; 
        #endregion

        #region Properties
        /// <summary>
        /// [id_role] CHAR(5) PRIMARY KEY
        /// </summary>
        public string IdRole
        {
            get { return this.idRole; }
            set { this.idRole = value; }
        }

        /// <summary>
        /// [nama_role] VARCHAR(50) NOT NULL
        /// </summary>
        public string NamaRole
        {
            get { return this.namaRole; }
            set { this.namaRole = value; }
        } 
        #endregion

        #region Constructors
        /// <summary>
        /// Konstruktor
        /// </summary>
        public Role()
        {

        }

        /// <summary>
        /// Konstruktor
        /// </summary>
        /// <param name="idRole">[id_role] CHAR(5) PRIMARY KEY</param>
        /// <param name="namaRole">[nama_role] VARCHAR(50) NOT NULL</param>
        public Role(string idRole, string namaRole)
        {
            this.idRole = idRole;
            this.namaRole = namaRole;
        } 
        #endregion

        public override string ToString()
        {
            return string.Format("ID_ROLE: {0} | NAMA_ROLE: {1}", this.idRole, this.namaRole);
        }
    }
}
